package com.nsxy.manager.login.controllers;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.nsxy.manager.common.controllers.BaseController;

/**
 * 用户认证
 * @author 潜行的青衣
 * @see
 */
@Controller
@RequestMapping("/manager/")
public class LoginController extends BaseController {

	@RequestMapping("login.jhtml")
	public String login(HttpServletRequest request, String username) {
		request.setAttribute("username", username);
		return "manager/login/login";
	}
	
	@RequestMapping("logout.jhtml")
	public String logout() {
		SecurityUtils.getSubject().logout();
		return "redirect:".concat(this.env.getProperty("shiro.login.url"));
	}
	
	@RequestMapping("index.jhtml")
	public String index() {
		
		return "manager/index";
	}
	
	
}
